package com.situ.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author yangkx
 * @create 2023-08-29-9:21
 */
@Data
public class User {

    private Integer id;

    private String username;

    private Integer typeId;

    private String password;

    private String phoneNumber;

    //序列化时间类（把创建时间转化为json字符串）
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    //并转化为如下格式
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;//创建时间

}
